﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AdminHomeSlideShow.ascx.cs" Inherits="smartphone.UserControls.AdminHomeSlideShow" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<div class="adminTable">
    <form id="AdminViewHomeImage" runat="server">
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
        <div class="adminTitle">
            <asp:Label ID="LabelInform" runat="server" Text="Quản lí slideshow trang chủ"></asp:Label>
        </div>
        <asp:GridView ID="GridViewHomeImage" runat="server" DataKeyNames="maHtt" Width="100%" AutoGenerateColumns="False" OnRowCancelingEdit="GridViewHomeImage_RowCancelingEdit" OnRowDeleting="GridViewHomeImage_RowDeleting" OnRowEditing="GridViewHomeImage_RowEditing" OnRowUpdating="GridViewHomeImage_RowUpdating">
            <Columns>
                <asp:ImageField ItemStyle-CssClass="adminThumbnail" DataImageUrlField="HttUrl" DataImageUrlFormatString="~/ProductImages/{0}" HeaderText="Hình" ReadOnly="True">
<ItemStyle CssClass="adminThumbnail"></ItemStyle>
                </asp:ImageField>
                <asp:BoundField DataField="Url" HeaderText="Đường dẫn" SortExpression="Url" />
                <asp:CommandField CancelText="Hủy" EditText="Sửa" HeaderText="Sửa" ShowEditButton="True" ShowHeader="True" UpdateText="Cập nhật" />
                <asp:TemplateField HeaderText="Xóa">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete" Text="Xóa" OnClientClick="return confirm('Bạn có chắc muốn xóa hình ảnh này?');"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>

        <div class="adminTitle">
            <asp:Label ID="LabelInform2" runat="server" Text="Thêm hình ảnh"></asp:Label>
        </div>
        <div>
            <label style="font-weight:bold">Chọn hình ảnh </label> <asp:FileUpload ID="FileUploadHomeImage" CssClass="adminUpload" runat="server" />
            <p style="margin-top: 20px">
                <label class="imageLink">Nhập đường dẫn (bao gồm Http://) </label>
                <asp:TextBox ID="TxtUrl" runat="server" Width="300"></asp:TextBox>
            </p>
            <asp:Button ID="BtCreateHomeImage" CssClass="adminButton" runat="server" Text="Thêm hình" OnClick="BtCreateHomeImage_Click" />
        </div>

    </form>
    
</div>